from django.db import models
from user.models import UserProfile
from video.models import Videos


# Create your models here.
class Comment(models.Model):
    cid = models.BigAutoField(primary_key=True)
    content = models.TextField()
    user = models.ForeignKey(UserProfile, on_delete=models.CASCADE, related_name='comment_user')
    video = models.ForeignKey(Videos, on_delete=models.CASCADE, related_name='comment_video')
    time = models.DateTimeField(auto_now_add=True)


class Comment_Comment(models.Model):
    ccid = models.BigAutoField(primary_key=True)
    content = models.TextField()
    user = models.ForeignKey(UserProfile, on_delete=models.CASCADE, related_name='comment_comment_user')
    comment = models.ForeignKey(Comment, on_delete=models.CASCADE, related_name='comment_comment')
    time = models.DateTimeField(auto_now_add=True)